<template>
  <div>
    <div>小马教育</div>
    <!-- <img src="~assets/logo.png" />
    <div class="icon"></div>-->
    <div>{{fullname}}</div>
    <div v-for="(item,key,index) in current" :key="index">
      <input v-model="current[key]" @input="oInput(key)" />
    </div>
    <div>
      <p>{{tempName}} ++++++++++tempName</p>
      <p>{{name}} ++++++++++name</p>
      <p>{{current}}</p>
      <p>{{tempInformation}}</p>
      <p>{{testName}} </p>
      <p @click="btnClick">修改参数</p>
    </div>
  </div>
</template>

<script>
export default {
  name: "XiaoMa",
  props: ["aArr", "name", "information", "testName"],
  data() {
    console.log(123)
    return {
      first: "2",
      second: "3",
      current: this.aArr,
      tempName:this.name
    };
  },
  computed: {
    fullname() {
      return this.first + this.second;
    }
  },
  created() {
    this.initData();
  },
  methods: {
    oInput(tem) {
      //this.current[tem] = event.target.value;
      //this.$emit("oInput", this.current);
    },
    initData() {
      this.tempInformation = JSON.parse(JSON.stringify(this.information))
      this.tempTestName = this.testName
      //this.tempName = this.name
      //this.tempName='hello'
      this.tempInformation.age = 100
      //this.arr=JSON.parse(JSON.stringify(this.information))
      this.tempInformation.address.homeAddress = '子组件修改'
    },
    btnClick(){
      this.tempName='tom'
      //this.arr.name='jimi'
      //this.tempInformation.age = 100
    }
  }
};
</script>

<style>
.icon {
  width: 200px;
  height: 200px;
  background: url("~assets/logo.png");
}
</style>